import request from '@/axios/request'
import url from '@/axios/url'
const { mesUrl, adminUrl, wmsUrl } = url()
// 导出url
export const exportUrl = `${mesUrl}mesProdOrder/export`

/**
 * 新增
 * @param data
 * @returns {*|Promise<*>}
 */
export function mesTmMaterialBaseCreate(data = '') {
  return request({
    url: `${mesUrl}mesTmMaterialBase/c`,
    method: 'post',
    data: data
  })
}

/**
 * 修改
 * @param data
 * @returns {*|Promise<*>}
 */
export function mesTmMaterialBaseUpdate(data = '') {
  return request({
    url: `${mesUrl}mesTmMaterialBase/u`,
    method: 'post',
    data: data
  })
}

/**
 * 分页
 * @param data
 * @returns {*|Promise<*>}
 */
export function mesTmMaterialBasePage(data = {}) {
  return request({
    url: `${mesUrl}mesTmMaterialBase/page`,
    method: 'get',
    params: data
  })
}

export function mesTmMaterialBasePageJc(data = {}) {
  return request({
    url: `${mesUrl}mesTmMaterialBase/page`,
    method: 'get',
    params: {...data,materialTypes:'辅料,集采'}
  })
}
/**
 * 不分页
 * @param data
 * @returns {*|Promise<*>}
 */
export function mesTmMaterialBaseList(data = {}) {
  return request({
    url: `${mesUrl}mesTmMaterialBase/list`,
    method: 'get',
    params: data
  })
}
/**
 * 删除
 * @param id
 * @returns {*|Promise<*>}
 */
export function mesTmMaterialBaseDeleteById(id = '') {
  return request({
    url: `${mesUrl}mesTmMaterialBase/d/${id}`,
    method: 'post'
  })
}


export function mesTmMaterialBaseSup(code = '') {
  return request({
    url: `${mesUrl}mesTmMaterialBase/sup/${code}`,
    method: 'get'
  })
}
